/*
 * GameResult.java
 * Copyright(C) trythis.cn
 * 2022年12月17日 19时46分25秒Created
 */
package com.njcb.game.repository.dao;

import com.njcb.ams.repository.dao.base.BaseMyBatisDAO;
import com.njcb.ams.repository.dao.mapper.BaseMapper;
import com.njcb.game.repository.dao.mapper.GameResultMapper;
import com.njcb.game.repository.entity.GameRegisterExample;
import com.njcb.game.repository.entity.GameResult;
import com.njcb.game.repository.entity.GameResultExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Repository
public class GameResultDAO extends BaseMyBatisDAO<GameResult, GameResultExample, Integer> {
    @Autowired
    private GameResultMapper mapper;

    public GameResultDAO() {
        this.entityClass = GameResult.class;
    }

    @Override
    @SuppressWarnings("unchecked")
    public GameResultMapper getMapper() {
        return mapper;
    }

    public GameResult selectByQustId(Integer qustId) {
        GameResultExample example = new GameResultExample();
        example.createCriteria().andQustIdEqualTo(qustId);
        return selectOneByExample(example);
    }
}